package com.winz.cultureapp.adapter.xrcv;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.mine.xrecyclerview.rcvadapter.BaseRcvAdapter;
import com.mine.xrecyclerview.rcvadapter.ViewHolder;
import com.winz.cultureapp.R;
import com.winz.cultureapp.entity.PersonItem3ListBean;

import java.util.List;

/**
 * 个人记录--志愿服务
 */

public class PersonalItem3Adapter extends BaseRcvAdapter<PersonItem3ListBean.DataBean.ListBean> {

    public PersonalItem3Adapter(Context context, List<PersonItem3ListBean.DataBean.ListBean> datas, int... resid) {
        super(context, datas, resid);
    }

    @Override
    public void convert(ViewHolder holder, PersonItem3ListBean.DataBean.ListBean data, int itemViewType) {

    }

    @Override
    public void convert(int position, ViewHolder holder, PersonItem3ListBean.DataBean.ListBean listBean, int itemViewType) {
        super.convert(position, holder, listBean, itemViewType);
        if (itemViewType != -1){

            holder.setText(R.id.tv_title,"茂名市综艺专场")
                    .setText(R.id.tv_state,"已报名")
                    .setText(R.id.tv_time,"服务时间: 2019-04-08 13:00-17:00")
                    .setText(R.id.tv_adress,"地址：安亭镇图书馆（墨玉路149号）")
                    .setText(R.id.tv_time2,"时间：2019-04-08 13:00")
                    .setText(R.id.tv_tell,"联系电话：12345678912")
                    .setText(R.id.tv_hour,"服务小时: 4小时");

            Glide.with(mContext)
                    .load(R.drawable.pic_default)
                    .error(R.drawable.pic_default)
                    .into((ImageView) holder.getView(R.id.iv_pic));
            if (position == 0){
                holder.getView(R.id.view_header).setVisibility(View.VISIBLE);
            }else{
                holder.getView(R.id.view_header).setVisibility(View.GONE);
            }
        }


    }
}
